Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTHAB-206: Add send invoice by email in bulk action menu for bulk invoice sending #978

Merged
merged 4 commits into from
Sep 26, 2023

Conversation

olayiwola-compucorp
Copy link

@olayiwola-compucorp olayiwola-compucorp commented Sep 26, 2023

Overview

This PR adds Send invoice by email in the bulk action menu for bulk invoice sending

Before

The Send Invoice by email action doesn't exist in the bulk action in the contribution search kit view
image

After

The Send Invoice by email action exists in the bulk action in the contribution search kit view
Screenshot 2023-09-26 at 04 51 43

lokiki

With the invoice-helper extension installed, the Template field is displayed
Screenshot 2023-09-26 at 07 16 27

Technical Details

This functionality uses the CiviCRM CRM_Contribute_Form_Task_Invoice class to send the email, to avoid having to duplicate the code, this also allows us to keep other customizations provided by third-party extensions like invoice-helper to the bulk contribution email screen.

The caveat is that CRM_Contribute_Form_Task_Invoice class is meant to redirect to a contribution view after sending the email as hardcoded from the code. We introduced custom logic to override this redirect here

if ($formName == 'CRM_Contribute_Form_Task_Invoice' && !empty($form->getVar('_submitValues')['mail_task_from_sk'])) {
CRM_Utils_System::redirect($_SERVER['HTTP_REFERER']);
}

@olayiwola-compucorp olayiwola-compucorp merged commit 33ebeab into BTHAB-3-workstream Sep 26, 2023
2 checks passed
@olayiwola-compucorp olayiwola-compucorp deleted the BTHAB-206-bulk-invoice branch September 26, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants